home *** CD-ROM | disk | FTP | other *** search
/ NOVA - For the NeXT Workstation / NOVA - For the NeXT Workstation.iso / Documents / NeXTAnswers / sysadmin.556 < prev    next >
Text File  |  1992-02-06  |  2KB  |  57 lines

  1. {\rtf0\ansi{\fonttbl\f0\fnil Times-Roman;\f2\fmodern Courier;\f1\fswiss Helvetica;}
  2. \paperw11760
  3. \paperh7200
  4. \margl120
  5. \margr120
  6. \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\f0\b0\i0\ul0\fs28 yp NIS netinfo update\
  7. \
  8. Q:  How can I change my password from a non-NeXT machine, given that the NIS (formerly known as Yellow Pages or "YP") database is mastered by NetInfo?\
  9. \
  10. A:   Replace the standard yppasswd command on the non-NeXT machine with a shell script that rsh's the NetInfo master server and passes the arguments on as arguments to passwd.  Something like:\
  11. \
  12.  
  13. \f2\fs24 #\
  14. # replace the yppasswd command on your non-NeXT machine with this shell\
  15. # script. This shell script checks if it received a username as an\
  16. # argument, if not it will default to the user that executes the command.\
  17. # The script turns echo off, logs into the configuration server and runs\
  18. # the passwd command that updates the NetInfo database. It then restores\
  19. # the echo status to it's initial value.\
  20. #\
  21. \
  22. #!/bin/csh\
  23. set Server = "ni_server"\
  24. set Account = $\{1\}\
  25. if ($\{Account\} == "") then\
  26.     set Account  = `whoami`\
  27. endif\
  28. (stty > /dev/tty) |& grep '.-echo' >& /dev/null\
  29. if ( $\{status\} != 0 ) then\
  30.     set NoEcho=0\
  31. else\
  32.     set NoEcho=1\
  33. endif\
  34.  \
  35. stty -echo\
  36. rsh $\{Server\} /bin/passwd $Account\
  37. if ( $\{NoEcho\} == 0 ) then\
  38.     stty echo\
  39. endif\
  40.  
  41. \f0\fs28 \
  42. Then, every 5 minutes (or 15, or 30...), have cron test for changes in the password file by nidumping and comparing.  If they are different, automatically perform a ypmake for the password file.   Alternately, have the rsh touch a file on the master server that causes cron to dump and push the database.\
  43. \
  44. Replace 
  45. \f2\fs24 ni_server
  46. \f0\fs28  in the above shell script with the name of your configuration server. The shell script assumes that the hosts are equivalent, see the man page for hosts.equiv(5) for more information. Be sure to make this shell script read-only and set its ownership to root.\
  47. \
  48. \
  49. QA556\
  50. \
  51.  
  52. \pard\tx620\tx1240\tx1860\tx2480\tx3100\tx3720\tx4340\tx4980\tx5600\tx6220 Valid for 1.0\
  53. Valid for 2.0\
  54.  
  55. \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600 \
  56.  
  57.